package ie.wit.loanmanager;

import java.util.Calendar;
import java.util.GregorianCalendar;

import ie.wit.loanmanager.exceptions.TheLoanListIsEmptyException;
import ie.wit.loanmanager.exceptions.ThereIsNoLoanWithThisIdException;
import ie.wit.loanmanager.exceptions.UnknownItemException;
import ie.wit.loanmanager.gui.LoanManagerGui;


public class Main {
	
	public static void main(String[] args) throws UnknownItemException, ThereIsNoLoanWithThisIdException, TheLoanListIsEmptyException {
			
		
//		Calendar initialDate = Calendar.getInstance();
//		System.out.println(initialDate.get(initialDate.YEAR) + "/" +
//				   initialDate.get(initialDate.MONTH) + "/" +
//				   initialDate.get(initialDate.DAY_OF_MONTH));
//		Calendar finalDate = new GregorianCalendar(2014, 9, 17);
//		System.out.println(initialDate.compareTo(finalDate));
		
		
			//This code starts the Controller
			ControllerSystem c = ControllerSystem.getInstance();
	        
			//This code starts the GUI
			LoanManagerGui manager = c.getGui();
	        
	        int option;
	        do {
	        	option = manager.menuMain();
			   
			   switch(option)
			   		{
			   		case 1  : manager.menuAddLoan("","","","","","");
			   			  break;
			   		case 2  : manager.menuRemoveLoan();
			   			  break;
			   		case 3  : c.listAllLoan();
			   		      break;		 
			   		case 4  : c.listLoanMe();
			   		case 5  : break;
			   		default : break;
			   		}
	        } while(option != 5);
			
        
	}

}
